package com.lee.common.component;

import java.util.List;

import org.springframework.stereotype.Component;

import com.alibaba.dubbo.config.annotation.Reference;
import com.lee.system.api.IDictDataService;
import com.lee.system.entity.DictData;


/**
 * html调用 thymeleaf 实现字典读取
 * 
 * @author LiPengFei
 *
 */
@Component
public class DictService {
	@Reference
	private IDictDataService dictDataService;

	/**
	 * 根据字典类型查询字典数据信息
	 * 
	 * @param dictType
	 *            字典类型
	 * @return 参数键值
	 */
	public List<DictData> selectDictData(String dictType) {
		return dictDataService.selectDictDataByType(dictType);
	}
    /**
     * 根据字典类型和字典键值查询字典数据信息
     * 
     * @param dictType 字典类型
     * @param dictValue 字典键值
     * @return 字典标签
     */
    public String getLabel(String dictType, String dictValue)
    {
        return dictDataService.selectDictLabel(dictType, dictValue);
    }

}
